package com.example.mobile2021606144ywr0323;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        EditText edtAccount=findViewById(R.id.edtTxt_main_account);
        EditText editPSW = findViewById(R.id.edtTxt_main_psw);
        EditText editPSW2 = findViewById(R.id.edtTxt_main_psw2);

        Button btnRegister=findViewById(R.id.btm_main_register);

        editPSW2.setOnKeyListener(new View.OnKeyListener() {
            @Override
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                return false;
            }
        });
        editPSW2.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if(hasFocus) {
                    EditText editText = (EditText)v;
                    editText.setText("123");
                }else{
                    EditText editText=(EditText)v;
                    editText.setText("567");

                }
            }
        });
        btnRegister.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

        String strAccount=edtAccount.getText().toString();
        String strpsw=editPSW.getText().toString();
        String strpsw2=editPSW2.getText().toString();


                btnRegister.setOnClickListener(new MyOnClick());
                btnRegister.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {

                    }
                });


            }
        });
    }

}

    class MyOnClick implements View.OnClickListener{

    @Override
        public void onClick(View V){

    }

    }